package com.example.su_shi_tan_bas_lib.utils

import android.graphics.drawable.Drawable
import android.text.Editable
import android.view.View
import android.widget.ImageView
import androidx.databinding.BindingAdapter
import com.example.su_shi_tan_bas_lib.glidmodule.GlideApp


interface OnTextListener {
    fun afterTextChanged(s: Editable?, viewId: Int)
}

@BindingAdapter(value = ["imageUrl", "error"],requireAll = false)
fun loadImage(view: ImageView, url: String?, error: Drawable?) {
    GlideApp.with(view.context).load(url).error(error).into(view)
}


@BindingAdapter(value = ["selected"])
fun setViewSelect(view: View, selected: Boolean) {
    view.isSelected = selected
}